﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_FlowForm.cshtml";
}@using LeSoft.Application.Code;
<script src="~/Content/scripts/jquery/layer/jquery.js?v=1.83.min"></script>
<script src="~/Content/scripts/jquery/layer/layer.min.js"></script>
<link href="~/Content/styles/font-awesome.min.css" rel="stylesheet" />
<link href="~/Content/styles/BillDetail.css?v=1.1" rel="stylesheet" />
<link href="~/Content/styles/anitmate.css" rel="stylesheet" />
<link href="~/Content/styles/style.css" rel="stylesheet" />
<link href="~/Content/scripts/plugins/tree/tree.css" rel="stylesheet" />
<link href="~/Content/scripts/plugins/jqgrid/jqgrid.css" rel="stylesheet" />
<script src="~/Content/scripts/plugins/tree/tree.js"></script>
<script src="/Content/scripts/plugins/validator/js?v=XgpF3bkqcHESsLip2j1dhS6n2I-zHyD2VCazpanqH6Q1"></script>
<script src="/Content/scripts/utils/js?v=FNqaC7G7A87_J4VCIQpQEAO-d_2Qf2wSxoZexwRzulo1"></script>
<script src="~/Content/scripts/plugins/jqgrid/jqgrid.js"></script>
<script src="~/Content/scripts/jquery/ajaxfileupload.js"></script>
<script>
    var keyValue = request('keyValue');
    var organizeid = " @LeSoft.Application.Code.OperatorProvider.Provider.Current().CompanyId";
    var State = "";
    var WeekBillId = "";
    var Week = request("Week");
    var Count = request("Count");
    var Year = request("Year");
    var Type = request('Type');
    $(function () {
        initControl();
        $("#AllChk").change(function () {
            $(".CS_1").each(function () {
                if ($(this).attr("type") == "checkbox") {
                    $(this).attr("checked", !!$("#AllChk").attr("checked"));
                };
            })
        })
    })
    function initControl() {
        var Mode = "@ViewBag.Mode";
        if (Mode == "True") {
            $("#Code").attr("placeholder", "系统已启用自动编号").attr("disabled", "disabled");
        } else {
            $("#Code").attr("isvalid", "yes").attr("checkexpession", "NotNull").attr("placeholder", "请输入编号");
        }
        $("#OrganizeId").ComboBoxTree({
            url: "../../BaseManage/Organize/GetTreeJsonById",
            description: "==请选择所属机构==",
            height: "250px",
            click: function (data) {
                organizeid = data.id;
            }
        });
        $("#OrganizeId").ComboBoxSetValue(organizeid);
        $("#State").ComboBox({
            //  url: " ",
            data: [{ "key": "1", "value": "待处理" }, { "key": "2", "value": "派单中" }, { "key": "3", "value": "进行中" }, { "key": "4", "value": "已完成" }, { "key": "5", "value": "已取消" }, { "key": "6", "value": "已退单" }],
            id: "key",
            text: "value",
            description: "=选择工单状态=",
            height: "150px"
        });
        $("#State").ComboBoxSetValue(1);
        $("#SendWay").ComboBox({
            //  url: " ",
            data: [{ "key": "1", "value": "线上" }, { "key": "0", "value": "线下" }],
            id: "key",
            text: "value",
            description: "=选择派工方式=",
            height: "150px",
            click: function (e) {
                State = e.attr('data-value');
                if (e.attr('data-value') != 0) {
                    $(".BaseClass").attr("disabled", "disabled");
                }
                else {
                    $(".BaseClass").removeAttr("disabled");
                }
            }
        });
        //获取表单
        if (!!keyValue) {
            if (!!Week) {
                var queryJson = {
                    ItemId: keyValue,
                    Week: Week,
                    Type: Type,
                    Count: Count,
                    Year: Year
                };
                $.SetForm({
                    url: "../../PropertyManage/CS_DeviceMaintanenceBill/GetWeekBillEntityByTime",
                    param: { queryJson: JSON.stringify(queryJson) },
                    success: function (data) {
                        if (data.data1.State != "1") {
                            $(".BaseClass1").attr("disabled", "disabled");
                        }
                        organizeid = data.data1.OrganizeId;
                        $("#Weekform").SetWebControls(data.data1);
                        $("#WeekPlanCode").val(data.data2);
                        $("#Memo").val(data.data3);
                        SetFileDisplay(data.data4);
                        GetGrid3(data.data1.OperateMemo)
                    }
                })
            }
            else {
                $.SetForm({
                    url: "../../PropertyManage/CS_DeviceMaintanenceBill/GetWeekBillEntity",
                    param: { keyValue: keyValue },
                    success: function (data) {
                        if (data.data1.State != "1") {
                            $(".BaseClass1").attr("disabled", "disabled");
                        }
                        organizeid = data.data1.OrganizeId;
                        $("#Weekform").SetWebControls(data.data1);
                        $("#WeekPlanCode").val(data.data2);
                        $("#Memo").val(data.data3);
                        SetFileDisplay(data.data4);
                        GetGrid3(data.data1.OperateMemo)
                    }
                })
            }
        };
    }
    function AcceptClick() { //保存表单
        if (!$('#Weekform').Validform()) {

            return false;
        }

        var postData = $("#Weekform").GetWebControls(keyValue);
        UploadFile();
        $.SaveForm({
            url: "../../PropertyManage/CS_DeviceMaintanenceBill/SaveWeekBillForm?keyValue=" + keyValue,
            param: postData,
            loading: "正在保存数据...",
            success: function () {
                dialogClose();
            }
        })
    }
    function GetGrid1(data) {

        var selectedRowIndex = 0;
        $gridTable = $("#gridTable1")
        $gridTable.jqGrid({
            url: "../../PropertyManage/CS_DeviceMaintanenceBill/GetWeekBillResultList?keyValue=" + WeekBillId,
            datatype: "json",
            height: 240,
            autowidth: true,
            unwritten: false,
            colModel: [
                { label: "主键", name: "Id", hidden: true },
                { label: "设备种类", name: "", index: "Sort", width: 200, align: "center", sortable: false },
                { label: "设备名称", name: "Memo", index: "Memo", width: 200, align: "center", sortable: false },
                { label: "设备编号", name: "Actuality", index: "Actuality", width: 250, align: "center", sortable: false },
                { label: "内容要点", name: "Content", index: "Content", width: 250, align: "center", sortable: false },
                { label: "内容要求", name: "Result", index: "Result", width: 250, align: "center", sortable: false },
                { label: "是否完成", name: "IsComplete", index: "IsComplete", width: 250, align: "center", sortable: false },
                { label: "完成时间", name: "CompleteDate", index: "CompleteDate", width: 250, align: "center", sortable: false },
                { label: "完成人", name: "CompleteDate", index: "CompleteDate", width: 250, align: "center", sortable: false },
                { label: "完成情况", name: "CompleteDate", index: "CompleteDate", width: 250, align: "center", sortable: false },
                { label: "情况描述", name: "CompleteDate", index: "CompleteDate", width: 250, align: "center", sortable: false },
                { label: "结果", name: "CompleteDate", index: "CompleteDate", width: 250, align: "center", sortable: false },
            ],
            viewrecords: true,
            rownumbers: false,
            onSelectRow: function (status) {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);

            }
        });
        $gridTable[0].addJSONData(JSON.parse("[" + data + "]"));
    }
    function GetData() {

        $.ajax({
            url: "../../PropertyManage/CS_DeviceMaintanenceBill/GetWeekBillContentDetail?keyValue=" + WeekBillId,
            type: "post",
            dataType: "json",
            success: function (data) {

                var DB = [];
                var str = data.ContentDetail.split("},");
                for (var i = 0; i < str.length; i++) {

                    if (i > 0) {
                        str[i] = str[i].substring(0, str[i].length - 1);
                    }
                    str[i] += ",\"Actuality\":\"<input name='Actuality' type='text' class='editable CS_1' />\"";
                    str[i] += ",\"Content\":\"<input name='Content' type='text' class='editable CS_1 ' />\"";
                    str[i] += ",\"Result\":\"<input name='Result' type='text' class='editable CS_1' />\"";
                    str[i] += ",\"IsComplete\":\"<input name='IsComplete' type='checkbox' class=' CS_1 ' />完成\"";
                    str[i] += "}"
                    DB.push(str[i]);
                }
                GetGrid1(DB);
            }
        });

    }
    function GetGrid2() {
        var selectedRowIndex = 0;
        $gridTable = $("#gridTable2")
        $gridTable.jqGrid({
            url: "../../PropertyManage/CS_DeviceMaintanenceBill/GetDeviceListByWeekBillList?keyValue=" + WeekBillId,
            datatype: "json",
            height: 230,
            autowidth: true,
            colModel: [
                { label: "主键", name: "Id", hidden: true },
               // { label: "序号", name: "Code", index: "Code", width: 200, align: "center", sortable: false },
                { label: "是否完成", name: "IsComplete", index: "IsComplete", width: 200, align: "center", sortable: false, hidden: true },
                { label: "设备类型", name: "Type", index: "Type", width: 200, align: "center", sortable: false },
                { label: "设备名称", name: "Name", index: "Name", width: 200, align: "center", sortable: false },
                { label: "设备编号", name: "Code", index: "Code", width: 208, align: "center", sortable: false },
                { label: "规格型号", name: "ModelNo", index: "ModelNo", width: 250, align: "center", sortable: false }
            ],
            viewrecords: true,
            rownumbers: true,
            onSelectRow: function (status) {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);
            }
        });


    }
    function GetGrid3(data) {

        var selectedRowIndex = 0;
        $gridTable = $("#gridTable3")
        $gridTable.jqGrid({
            datatype: "json",
            height: 650,
            autowidth: true,
            colModel: [
               { label: '项目主键', name: 'Id', hidden: true },
                        { label: '业务类别', name: 'Type', width: 100, align: 'center', sortable: false },
                        { label: '操作人', name: 'FromOperateName', width: 100, align: 'center', sortable: false },
                        { label: '操作时间', name: 'Date', width: 170, align: 'center', sortable: false },
                        {
                            label: "操作内容", name: "Content", index: "Content", width: 590, align: "left", sortable: false,
                            formatter: function (cellvalue, options, rowObject) {
                                if (!!rowObject.ToOperateName)
                                    return "发起者：" + rowObject.FromOperateName + "，接受者：" + rowObject.ToOperateName + "<br/>" + cellvalue;
                                else
                                    return "发起者：" + rowObject.FromOperateName + "<br/>" + cellvalue;
                            }
                        },
            ],
            viewrecords: true,
            rownumbers: true,
            onSelectRow: function (status) {
                selectedRowIndex = $("#" + this.id).getGridParam('selrow');
            },
            gridComplete: function () {
                $("#" + this.id).setSelection(selectedRowIndex, false);
            }
        });
        $gridTable[0].addJSONData(JSON.parse("[" + data + "]"));
    }
    function GetInfo(i) {
        if (organizeid == "") {
            dialogMsg("请选择组织机构！", 0);
            return false;
        }
        var options = {};
        switch (i) {
            case 1: //项目
                options["type"] = 11;
                options["data"] = [{ "id": "ItemName" }, { "id": "ItemId" }, { "id": "WeekPlanCode" }, { "id": "Memo" }];
                options["organizeid"] = organizeid;
                break;
            case 2: //派给
                options["type"] = 3;
                options["data"] = [{ "id": "ExecRole" }, { "id": "ExecRoleId" }];
                options["organizeid"] = organizeid;
                break;
            case 3: //派单人
                if (State == "1") { return false; };
                options["type"] = 3;
                options["data"] = [{ "id": "SendMan" }, { "id": "SendManId" }];
                options["organizeid"] = organizeid;
                break;
            case 4: //接单人
                if (State == "1") { return false; };
                options["type"] = 3;
                options["data"] = [{ "id": "ReceiveMan" }, { "id": "ReceiveManId" }];
                options["organizeid"] = organizeid;
                break;
            case 5: //执行人
                if (State == "1") { return false; };
                options["type"] = 3;
                options["data"] = [{ "id": "ExecMan" }, { "id": "ExecManId" }];
                options["organizeid"] = organizeid;
                break;
            case 6: //检查人
                options["type"] = 3;
                options["data"] = [{ "id": "CheckMan" }, { "id": "CheckManId" }];
                options["organizeid"] = organizeid;
                break;
            default: break;

        }
        DataItemClick(JSON.stringify(options));
    }
</script>
<script>
    var list = [];
    var _length = 0;
    var fileFilter = [];
    var img_index = 0;
    var img_src = "";
    $(function () {
        //上传图片
        $('#fileImage').change(function () {
            var files = document.getElementById('fileImage').files;
            var arrFile = [];

            if (files.length > 0) {
                if (fileFilter.length > 0) {
                    for (var j = 0, fileb; fileb = fileFilter[j]; j++) {
                        arrFile.push(fileb);
                    }
                    for (var i = 0, filea; filea = files[i]; i++) {
                        var count = 0;
                        for (var j = 0, fileb; fileb = fileFilter[j]; j++) {
                            if (filea.name == fileb.name && filea.size == fileb.size) {
                                count++;
                            }
                        }
                        if (count == 0) {
                            arrFile.push(filea);
                        }
                    }
                    SetFile(arrFile);
                }
                else {
                    SetFile(files);
                }
            }

        });
        //计算居中位置
        var mg_top = ((parseInt($(window).height()) - parseInt($(".photo-div").height())) / 2);

        $(".photo-div").css({
            "margin-top": "" + mg_top + "px"
        });
        //关闭
        $(".photo-close").click(function () {
            $(".photo-mask").hide();
            $(".photo-panel").hide();
        });
        //下一张
        $(".photo-panel .photo-div .arrow-next").click(function () {
            img_index++;
            if (img_index >= $("#preview li img").length) {
                img_index = 0;
            }
            img_src = $("#preview li img").eq(img_index).attr("src");
            photoView($("#preview li img"));
        });
        //上一张
        $(".photo-panel .photo-div .arrow-prv").click(function () {
            img_index--;
            if (img_index < 0) {
                img_index = $("#preview li img").length - 1;
            }
            img_src = $("#preview li img").eq(img_index).attr("src");
            photoView($("#preview li img"));
        });
        //调用
        $("#preview li img").live("click", function () {

            $(".photo-mask").show();
            $(".photo-panel").show();
            img_src = $(this).attr("src");
            img_index = $(this).index();
            photoView($(this));
        });
    });
    //自适应预览
    function photoView(obj) {
        if ($(obj).width() >= $(obj).height()) {
            $(".photo-panel .photo-div .photo-img .photo-view-h").attr("class", "photo-view-w");
            $(".photo-panel .photo-div .photo-img .photo-view-w img").attr("src", img_src);
        } else {
            $(".photo-panel .photo-div .photo-img .photo-view-w").attr("class", "photo-view-h");
            $(".photo-panel .photo-div .photo-img .photo-view-h img").attr("src", img_src);
        }


    }
    //显示上传文件
    function SetFile(files) {
        if (files.length > 5) {
            dialogMsg("最多只能传5个附件", 0);
            return;
        }

        fileFilter = files;
        var _html = "<ul>";
        for (var i = 0; i < files.length; i++) {
            if (files[i]) {
                if (files[i].constructor.name == "File") {
                    _html += "<li><a  title='删除' >x</a><img id='uploadImage_" + i + "' src='" + window.URL.createObjectURL(files[i]) + "'  /></li>";
                }
                else if (files[i].constructor.name == "Object") {
                    _html += "<li><a  title='删除'>x</a><img id='uploadImage_" + i + "' src='" + files[i].FileUrl + "'  /></li>";
                }
            }
        }
        _html += "</ul>"
        $("#preview").html(_html);
    }

    //上传文件到后台
    function UploadFile() {
        $.ajaxFileUpload({
            url: "../../WorkManage/WeekBill/UploadFile",
            secureuri: false,
            fileElementId: 'fileImage',
            dataType: 'json'
        });
    }
    function SetFileDisplay(dataArray) {
        var _html = "<ul>";

        if (dataArray.length > 0) {
            fileFilter = dataArray;
            for (var i = 0; i < dataArray.length; i++) {
                if (dataArray[i].Type == 21) {
                    _html += "<li><img id='uploadImage_" + i + "' src='" + dataArray[i].FileUrl + "'  /></li>";
                }
            }
            _html += "</ul>";
            $("#preview").html(_html);
        }

    }
</script>
<style>
    .CS_1 {
        text-align: center;
        border: none;
    }
</style>
<div id="wrapper" style="background:#fff;">
    <div id="left-side">
        <ul>
            <li class="choose active">
                基础信息
            </li>
            <li class="pay">
                执行详情
            </li>
            <li class="wrap">
                业务日志
            </li>
        </ul>
    </div>
    <div id="border">
        <div id="line" class="one"></div>
    </div>
    <div id="right-side" class="tab-content">
        <div id="first" class="tab-pane active">
            <div id="right-side" class="tab-content">
                <table class="form" id="Weekform">
                    <tr style=" height: 5px;"><td colspan="9"></td> </tr>
                    <tr>
                        <td class="formTitle">所属机构<font face="宋体">*</font></td>
                        <td class="formValue" colspan="2">
                            <div id="OrganizeId" type="selectTree" class="ui-select BaseClass1   " isvalid="yes" checkexpession="NotNull"></div>
                        </td>
                        <th class="formTitle">单据编号<font face="宋体">*</font></th>
                        <td class="formValue" colspan="2">
                            <input id="Code" type="text" class="form-control BaseClass1 " isvalid="yes" checkexpession="NotNull" />
                        </td>
                        <th class="formTitle">制单日期<font face="宋体">*</font></th>
                        <td class="formValue" colspan="2">
                            <input id="Date" type="text" class="form-control input-wdatepicker BaseClass1 " placeholder="请输入制单日期" value="@LeSoft.Util.Time.GetToday("yyyy-MM-dd HH:mm:ss")" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle">工作项目<font face="宋体">*</font></td>
                        <td class="formValue" colspan="5">
                            <div class="input-group" style="width: 100%;">
                                <input id="ItemId" class="form-control" type="hidden" />
                                <input id="ItemName" type="text" class="form-control BaseClass1" />
                                <span class="input-group-btn">
                                    <a onclick="GetInfo(1);" class="form-control BaseClass1 " style="cursor: pointer "><i class="fa fa fa-book BaseClass1" style=" font-size: 20px; padding-right: 5px;  color: gray"></i></a>
                                </span>
                            </div>
                        </td>
                        <td class="formTitle">项目编号<font face="宋体">*</font></td>
                        <td class="formValue" colspan="2">
                            <input id="WeekPlanCode" type="text" class="form-control BaseClass1 " />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">计划开始日期<font face="宋体">*</font></th>
                        <td class="formValue" colspan="2">
                            <input id="BeginDate" type="text" class="form-control input-wdatepicker BaseClass1" placeholder="请输入开始日期" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                        <th class="formTitle">计划结束日期<font face="宋体">*</font></th>
                        <td class="formValue" colspan="2">
                            <input id="EndDate" type="text" class="form-control input-wdatepicker BaseClass1 " placeholder="请输入结束日期" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" valign="top" style="padding-top: 4px;">
                            任务说明
                        </th>
                        <td class="formValue" colspan="8">
                            <textarea id="Memo" class="form-control BaseClass1" style="height: 50px;"></textarea>
                        </td>
                    </tr>
                    <tr style="background: #B1ddff;">
                        <td class="formTitle">执行状态</td>
                        <td class="formValue" colspan="2">
                            <div id="State" type="select" style=" cursor: not-allowed;" readonly class="ui-select"></div>
                        </td>
                        <td class="formTitle">派工方式</td>
                        <td class="formValue" colspan="2">
                            <div id="SendWay" type="select" class="ui-select"></div>
                        </td>
                        <td class="formTitle"></td>
                        <td class="formValue" colspan="2">
                            <div class="checkbox">
                                <label>
                                    <input id="IS" type="checkbox" />
                                    是否外派
                                </label>
                            </div>
                        </td>
                    </tr>
                    <tr style="background: #B1ddff;" id="TrWay1">
                        <td class="formTitle">派给</td>
                        <td class="formValue" colspan="5">
                            <div class="input-group" style="width: 100%;">
                                <input id="ExecRoleId" class="form-control" type="hidden" />
                                <input id="ExecRole" type="text" class="form-control " />
                                <span class="input-group-btn">
                                    <a onclick="GetInfo(2);" class="form-control " style="cursor: pointer"><i class="fa fa fa-book" style=" font-size: 20px; padding-right: 5px;  color: gray"></i></a>
                                </span>
                            </div>
                        </td>
                        <td class="formTitle" colspan="3"></td>

                    </tr>
                    <tr>
                        <td class="formTitle">派单人</td>
                        <td class="formValue" colspan="2">
                            <div class="input-group" style="width: 100%;">
                                <input id="SendManId" class="form-control" type="hidden" />
                                <input id="SendMan" type="text" class="form-control BaseClass " />
                                <span class="input-group-btn ">
                                    <a onclick="GetInfo(3);" class="form-control BaseClass " style="cursor: pointer"><i class="fa fa fa-book BaseClass" style=" font-size: 20px; padding-right: 5px;  color: gray"></i></a>
                                </span>
                            </div>

                        </td>
                        <td class="formTitle">接单人</td>
                        <td class="formValue" colspan="2">
                            <div class="input-group" style="width: 100%;">
                                <input id="ReceiveManId" class="form-control" type="hidden" />
                                <input id="ReceiveMan" type="text" class="form-control BaseClass " />
                                <span class="input-group-btn">
                                    <a onclick="GetInfo(4);" class="form-control BaseClass " style="cursor: pointer"><i class="fa fa fa-book BaseClass" style=" font-size: 20px; padding-right: 5px;  color: gray"></i></a>
                                </span>
                            </div>
                        </td>
                        <td class="formTitle">执行人</td>
                        <td class="formValue" colspan="2">
                            <div class="input-group" style="width: 100%;">
                                <input id="ExecManId" class="form-control" type="hidden" />
                                <input id="ExecMan" type="text" class="form-control BaseClass " />
                                <span class="input-group-btn">
                                    <a onclick="GetInfo(5);" class="form-control BaseClass " style="cursor: pointer"><i class="fa fa fa-book BaseClass" style=" font-size: 20px; padding-right: 5px;  color: gray"></i></a>
                                </span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">派单时间:</th>
                        <td class="formValue" colspan="2">
                            <input id="SendDate" type="text" class="form-control input-wdatepicker BaseClass " placeholder="请输入派单时间" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                        <th class="formTitle">接单时间:</th>
                        <td class="formValue" colspan="2">
                            <input id="ReceiveDate" type="text" class="form-control input-wdatepicker BaseClass  " placeholder="请输入接单时间" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                    </tr>
                    <tr style=" height: 10px; border-bottom: 1px dashed #cecece;"><td colspan="9"></td> </tr>
                    <tr style=" height: 10px;"><td colspan="9"></td> </tr>
                    <tr>
                        <th class="formTitle">执行开始日期:</th>
                        <td class="formValue" colspan="2">
                            <input id="ExcuBeginDate" type="text" class="form-control input-wdatepicker  " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                        <th class="formTitle">执行结束日期:</th>
                        <td class="formValue" colspan="2">
                            <input id="ExcuEndDate" type="text" class="form-control input-wdatepicker  " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle" valign="top" style="padding-top: 4px;">
                            完成说明
                        </td>
                        <td class="formValue" colspan="8">
                            <textarea id="Description" class="form-control " style="height: 50px;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle"></td>
                        <td class="formValue" colspan="2">
                            <div class="checkbox">
                                <label>
                                    <input id="IsCheck" type="checkbox" />
                                    是否检查
                                </label>
                            </div>
                        </td>
                        <td class="formTitle">检查人</td>
                        <td class="formValue" colspan="2">
                            <div class="input-group" style="width: 100%;">
                                <input id="CheckManId" class="form-control" type="hidden" />
                                <input id="CheckMan" type="text" class="form-control  " />
                                <span class="input-group-btn">
                                    <a onclick="GetInfo(6);" class="form-control  " style="cursor: pointer"><i class="fa fa fa-book" style=" font-size: 20px; padding-right: 5px;  color: gray"></i></a>
                                </span>
                            </div>
                        </td>
                        <th class="formTitle">检查日期:</th>
                        <td class="formValue" colspan="2">
                            <input id="CheckDate" type="text" class="form-control input-wdatepicker  " onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" valign="top" style="padding-top: 4px;">
                            检查情况
                        </th>
                        <td class="formValue" colspan="8">
                            <textarea id="CheckMemo" class="form-control " style="height: 50px;"></textarea>
                        </td>
                    </tr>
                    <tr style=" height: 10px; border-bottom: 1px dashed #cecece;"><td colspan="9"></td> </tr>
                    <tr>
                        <td colspan="9">
                            <div class="box" style="height: 100px;">
                                <img style="position: relative; float: left; width: 60px; height: 60px;" src="~/Content/images/icon_app_add.png" />
                                <input id="fileImage" type="file" size="30" class="BaseClass" name="fileselect[]" multiple="multiple" style="position: absolute; width: 60px; height: 60px; opacity: 0;" />
                                <div id="preview" class="upload_preview"></div>
                                <div class="photo-mask"></div>
                                <div class="photo-panel">
                                    <div class="photo-div">
                                        <div class="photo-left">
                                            <div class="arrow-prv "></div>
                                        </div>
                                        <div class="photo-img">
                                            <div class="photo-bar">
                                                <div class="photo-close"></div>
                                            </div>
                                            <div class="photo-view-h">
                                                <img src="" />
                                            </div>
                                        </div>
                                        <div class="photo-right">
                                            <div class="arrow-next"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="second" class="tab-pane">
            <div id="right-side" class="tab-content">
                <div class="center-Panel">
                    <div class="titlePanel">
                        <div class="title-search">
                            <table><tr><td>作业要点说明</td> </tr></table>
                        </div>
                        <div class="toolbar">
                            <div class="btn-group">
                                <input id="AllChk" type="checkbox" />全部完成
                            </div>
                        </div>
                    </div>
                    <div class="gridPanel">
                        <table id="gridTable1"></table>
                    </div>
                </div>
                <div style="height:10px;"></div>
                <div class="center-Panel">
                    <div class="titlePanel">
                        <div class="title-search">
                            <table><tr><td>设施设备列表</td></tr></table>
                        </div>
                    </div>
                    <div class="gridPanel">
                        <table id="gridTable2"></table>
                    </div>
                </div>
            </div>
        </div>
        <div id="third" class="tab-pane">
            <div class="gridPanel">
                <table id="gridTable3"></table>
            </div>
        </div>
    </div>
    <script>
        var i = 1;
        $('.choose').click(function () {
            i = 1;
            $('.choose').addClass('active');
            $('.pay').removeClass('active');
            $('.wrap').removeClass('active');
            $('.ship').removeClass('active');
            $('#line').addClass('one');
            $('#line').removeClass('two');
            $('#line').removeClass('three');
            $('#line').removeClass('four');
            $('#first').addClass('active');
            $('#second').removeClass('active');
            $('#third').removeClass('active');
            $('#fourth').removeClass('active');
            $("#right-side table").css("margin", "15px 0px");
        });
        $('.pay').click(function () {
            WeekBillId = $("#ItemId").val();
            if (WeekBillId == "") {
                dialogMsg("请选择项目！", 0);
                return false;
            }
            else {
                if (i == "1") {
                    GetData();
                    GetGrid2();
                    i = 2;
                }
            }
            $('.pay').addClass('active');
            $('.choose').removeClass('active');
            $('.wrap').removeClass('active');
            $('.ship').removeClass('active');
            $('#line').addClass('two');
            $('#line').removeClass('one');
            $('#line').removeClass('three');
            $('#line').removeClass('four');
            $('#first').removeClass('active');
            $('#second').addClass('active');
            $('#third').removeClass('active');
            $('#fourth').removeClass('active');
            $("#right-side table").css("margin", "0px");
        });
        $('.wrap').click(function () {
            i = 1;
            $('.wrap').addClass('active');
            $('.pay').removeClass('active');
            $('.choose').removeClass('active');
            $('.ship').removeClass('active');
            $('#line').addClass('three');
            $('#line').removeClass('two');
            $('#line').removeClass('one');
            $('#line').removeClass('four');
            $('#first').removeClass('active');
            $('#second').removeClass('active');
            $('#third').addClass('active');
            $('#fourth').removeClass('active');
            $("#right-side table").css("margin", "0px");
        });



    </script>

</div>


